PYTHON-5886 - Fix synchro bug caused by ruff upgrade#2878
Open
NoahStapp wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the synchronization tooling and generated test files to account for formatting/lint changes introduced by a ruff upgrade, so tools/synchro.py can successfully regenerate the synchronous code/test tree from the asynchronous sources.
Changes:
- Fix
tools/synchro.pyto correctly enumerate async source/test files usingPath.iterdir()entries (avoiding path duplication) and correctly detect async-only tests by filename. - Update several sync/async mirrored tests to include additional
# noqacodes (RUF100, etc.) to satisfy newer ruff behavior. - Minor variable rename in a test to avoid an unused binding.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tools/synchro.py | Fixes file discovery and async-only test filtering so synchro can run after ruff-driven formatting changes. |
| test/utils_spec_runner.py | Adjusts # noqa list to align with ruff’s handling of unused noqa directives. |
| test/test_pooling.py | Adds RUF100 to # noqa to avoid ruff unused-noqa failures in the sync mirror. |
| test/test_encryption.py | Regenerated change in a range-query prose test (currently introduces a likely logic bug in Case 7). |
| test/test_client_metadata.py | Renames an unused tuple element to _metadata for lint cleanliness. |
| test/asynchronous/utils_spec_runner.py | Adds RUF100 to align with sync mirror and ruff behavior. |
| test/asynchronous/test_pooling.py | Adds RUF100 to align with sync mirror and ruff behavior. |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Member
|
Did you mean to cancel a few of the jobs? |
blink1073
reviewed
Jun 16, 2026
| ): | ||
| await self.client_encryption.encrypt( | ||
| 6 if cast_func is int else float(6), | ||
| 6 if cast_func is not int else float(6), |
Member
There was a problem hiding this comment.
Had this test been corrupted by the previous PR?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PYTHON-5886
Changes in this PR
Fixes the
synchro.pyscript to properly synchronize after the changes caused by ruff linting.Test Plan
Checklist
Checklist for Author
Checklist for Reviewer